<include file="public@storage"/>
<style>
    form {
        margin-top: 100px;
        padding-left: 50px;
        padding-right: 50px;
    }

</style>
</head>
<body>
<form class="form-horizontal table" id="form" onsubmit = "return checkClient()" action="{:url('storage/Client/editClient')}"  method="post"  >
    <div class="panel panel-primary">
        <div class="panel-heading">
            <h3 class="panel-title">编辑客户端</h3>
        </div>
        <div class="panel-body" >
            <div class="form-group" style="text-align:center">
                <div class="col-md-2 control-label">
                    <label for="code">编码：</label>
                </div>
                <div class="col-md-2">
                    <input type="text" name="code" id="code" class="form-control" value="{$client.code}" placeholder="必须填" required="required" autocomplete="off" readonly="true">
                    <input type="hidden" id="codeId" name='id' value="{$client.id}" >
                    <span id="code_error" style="color: red"></span>
                </div>

                <div class="col-md-2 control-label">
                    <label for="name">名字：</label>
                </div>
                <div class="col-md-2">
                    <input type="text" name="name" id="name" class="form-control" value="{$client.name}" placeholder="必须填" required="required" autocomplete="off" >
                </div>

                <div class="col-md-2 control-label">
                    <label for="storage">所属仓库：</label>
                </div>
                <div class="col-md-2">
                    <input type="hidden" id="storageUuid" value="{$client.storage_uuid}">
                    <select id="storage" name="storage" class="selectpicker  form-control" title="所属仓库" data-live-search="true"
                            multiple data-selected-text-format="count > 3" data-actions-box="true">
                        <volist name="storage" id="vo">
                            <option value="{$vo.uuid}">{$vo.name}</option>
                        </volist>
                    </select>
                    <span id="storage_error" style="color: red"></span>
                </div>

                <div class="col-md-2 control-label" style="margin-top: 20px">
                    <label for="remark">标注：</label>
                </div>
                <div class="col-md-2" style="margin-top: 20px">
                    <input type="text" name="remark" id="remark" class="form-control" value="{$client.remark}" placeholder="选填"  autocomplete="off" >
                </div>

                <div class="col-md-2 control-label" style="margin-top: 20px">
                    <label for="status">状态：</label>
                </div>
                <div class="col-md-2" style="margin-top: 20px">
                    <input type="text" name="status" id="status" class="form-control" value="{$client.status}" placeholder="必须填" required="required" autocomplete="off">
                    <span id="status_error" style="color: red"></span>
                </div>
            </div>
        </div>
        <div class="form-group text-center">
            <button type="submit" class="mui-btn mui-btn--raised mui-btn--primary" id="submit">保存</button>
            &nbsp;&nbsp;
            <button type="button" class="mui-btn mui-btn--raised mui-btn--primary" onclick="history.go(-1)">取消</button>
        </div>
    </div>
</form>
</body>
<script src="__STATIC__/storage/js/client/add.js"></script>
<script>
    window.onload = function () {
        var storageUuid = $('#storageUuid').val();
        $("#storage").selectpicker('val', storageUuid);
    };


</script>
</html>